home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-07-16 | 2.9 KB | 67 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CFitness.h ©1995-97 Timo Eloranta All rights reserved.
- // ===========================================================================
- // This class is used for storing the fitness of a single graph drawing,
- // as well as for comparing the quality of different drawings.
-
- #pragma once
-
- #include "MyStructs.h"
-
- #include <PP_Types.h>
-
- class CFitness
- {
- private:
- Int32 mCrossings, // Nbr of edge crossings
- mEdgeDeviation, // Edge length deviation (sum)
- mMinNodeDistance, // Distance between the
- // closest pair of nodes
- mMinDistSum, // Sum of minimum node-to-node
- // distances
- mSecondValue; // Value of the fitness function
-
- static SEvaluation *sEvaluation; // Ptr to an evaluation struct
-
- public:
- CFitness();
-
- void SetCrossings( Int32 inCrossings )
- { mCrossings = inCrossings; };
-
- void SetEdgeStuff( Int32 inDeviation )
- { mEdgeDeviation = inDeviation; };
-
- void SetMinDistance( Int32 inMinDist,
- Int32 inMinDistSum = 0,
- Int16 inNodes = 0,
- Int16 inGridSize = 0 );
-
- static void SetEvalStruct( SEvaluation *inEvalStruct )
- { sEvaluation = inEvalStruct; };
-
- static Boolean CrossingsRule()
- { return sEvaluation -> crossingsRule; }
-
- CFitness &operator=( const CFitness & inFitness);
-
- Int32 GetCrossings() const
- { return mCrossings; };
- Int32 GetDeviation() const
- { return mEdgeDeviation; };
- Int32 GetMinDistance() const
- { return mMinNodeDistance; };
- Int32 Get2ndValue() const
- { return mSecondValue; };
-
- Boolean operator==( const CFitness & inFitness ) const;
- Boolean operator<( const CFitness & inFitness ) const;
- };
-
- // ===========================================================================
- // • Inline Functions
- // ===========================================================================
-
- // ———————————————————————————————————————————————————————————————————————————
- // • operator==
- // ———————————————————